package org.example.filter;


import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

/**
 * filter基于servlet，适合处理所有http请求的操作，例如跨域设置、编码格式
 */
@Component
public class MyFilter implements Filter {

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("myFilter执行!!!");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
